/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.general.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 *
 * @author lizardo
 */
@Entity
@Table(name = "gen_zona")
//@NamedQueries({@NamedQuery(name = "Zona.findAll", query = "SELECT z FROM Zona z"), @NamedQuery(name = "Zona.findByZoaCodigo", query = "SELECT z FROM Zona z WHERE z.zoaCodigo = :zoaCodigo"), @NamedQuery(name = "Zona.findByZoaNombre", query = "SELECT z FROM Zona z WHERE z.zoaNombre = :zoaNombre"), @NamedQuery(name = "Zona.findByZoaActivo", query = "SELECT z FROM Zona z WHERE z.zoaActivo = :zoaActivo")})
public class Zona implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "zoa_codigo")
    private Integer zoaCodigo;
    @Basic(optional = false)
    @Column(name = "zoa_nombre")
    private String zoaNombre;
    @Basic(optional = false)
    @Column(name = "zoa_activo")
    private boolean zoaActivo;
    
    @JoinColumn(name = "fk_dis_codigo", referencedColumnName = "dis_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Distrito fkDisCodigo;
    @JoinColumn(name = "fk_zon_codigo", referencedColumnName = "zon_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private TipoZona fkZonCodigo;



    public Zona() {
    }

    public Zona(Integer zoaCodigo) {
        this.zoaCodigo = zoaCodigo;
    }

    public Zona(Integer zoaCodigo, String zoaNombre, boolean zoaActivo) {
        this.zoaCodigo = zoaCodigo;
        this.zoaNombre = zoaNombre;
        this.zoaActivo = zoaActivo;
    }

    public Integer getZoaCodigo() {
        return zoaCodigo;
    }

    public void setZoaCodigo(Integer zoaCodigo) {
        this.zoaCodigo = zoaCodigo;
    }

    public String getZoaNombre() {
        return zoaNombre;
    }

    public void setZoaNombre(String zoaNombre) {
        this.zoaNombre = zoaNombre;
    }

    public boolean getZoaActivo() {
        return zoaActivo;
    }

    public void setZoaActivo(boolean zoaActivo) {
        this.zoaActivo = zoaActivo;
    }

    public Distrito getFkDisCodigo() {
        return fkDisCodigo;
    }

    public void setFkDisCodigo(Distrito fkDisCodigo) {
        this.fkDisCodigo = fkDisCodigo;
    }

    public TipoZona getFkZonCodigo() {
        return fkZonCodigo;
    }

    public void setFkZonCodigo(TipoZona fkZonCodigo) {
        this.fkZonCodigo = fkZonCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (zoaCodigo != null ? zoaCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Zona)) {
            return false;
        }
        Zona other = (Zona) object;
        if ((this.zoaCodigo == null && other.zoaCodigo != null) || (this.zoaCodigo != null && !this.zoaCodigo.equals(other.zoaCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.general.bc.Zona[zoaCodigo=" + zoaCodigo + "]";
    }
}
